/*
sorting template
created by nobles0ul on 8th nov
all rights reserverd (c) nobles0ul

*/

template<typename t>
void selectsort(t *ptr , int no)
{
	int pos;
	t small;
	for(int i=0;i<no;i++)
	{
	small = ptr[i];
	for(int j=i+1;j<no;j++)
	{
		if(small>ptr[j])
		{
			small= ptr[j];
			pos = j;
		}
		
	}
	t temp;
	temp = ptr[i];
	ptr[i] = ptr[pos];
	ptr[pos] = temp;
	}
}


// insertion sort

template<typename x>
void  insertsort(x *ptr,int no)
{
	for(int i=1;i<=no;i++)
	{
		x temp;
		temp = ptr[i];
		int j;
		j=i-1;
		
		while(temp < ptr[j])
		{
			ptr[j+1] = ptr[j];
			j--;
		}
		
		ptr[j+1] = temp;
		
	}
	
	
	
	
}